/*
 * TeamRocket_Main - main class for lack of a better name.
 * This code may (and probably will move elsewhere).
 * 
 * 	To Do
 * 	-----------------------------------------------------------------------------------------
 * 	More than you can imagine. This class is only stub, proving workability
 * 
 *  Revision History
 *  ------------------------------------------------------------------------------------------
 *  Who					Date			What's changed & Why & Notes
 * 	Colin Smith			1/10/2011		Created (Over the past week). For some reason breaks
 * 										when I compile through eclipse. Javac compiles it fine though.
 * 										I wouldn't modify any of this code. It's dirty as hell, I'm just 
 * 										submitting it so you can all see what stuff looks like.
 * 
 * 
 */

import javax.swing.JFrame;
import Framework.*;




public final class TeamRocket extends JFrame{
	static String CLASS = "TeamRocket_Main"; 
	
	JFrame w_HardwareDisplay; // Displays hardware information with buttons etc..
	
	public nv_ImageLoader 	imageLoader = new nv_ImageLoader();
	public debugMessage 	debug = new debugMessage();
	
	// Window instantiation!. This is because we don't want to run around constructing/destructing windows.
	public static win_mainWindow 		w_mainWindow	 	= new win_mainWindow();
	
	public static win_Media 			w_Media 			= new win_Media();
		public static win_Playlist		w_Playlist			= new win_Playlist();
		public static win_MoviePlayer 	w_MoviePlayer		= new win_MoviePlayer();
		public static win_MediaLibrary	w_MediaLibrary		= new win_MediaLibrary();
		
	public static win_MapExample	w_MapExample			= new win_MapExample();
	
	public static win_Scratchpad	w_Scratchpad			= new win_Scratchpad();
	
	public static win_Utilities		w_Utilities				= new win_Utilities();
		public static win_Calculator		w_Calculator	= new win_Calculator();
		public static win_Calendar		w_Calendar				= new win_Calendar();
		public static win_Converter		w_Converter				= new win_Converter();
		public static win_Browser		w_Browser				= new win_Browser();
	
	public void goHome(){
		this.setContentPane(w_mainWindow);
		this.validate();
		
	}
	
	TeamRocket(){
		String METHOD = "TeamRocket_Main()";
		debugMessage.log(CLASS + "." + METHOD + " Called.", 10);
		ConfigOpts.win_MainWindow = w_mainWindow;
		nv_ImageLoader.changeTheme("ActuallyRectangular");
		this.repaint();
		this.setSize((int)(850 * ConfigOpts.SCREEN_MULTIPLY),650);
		
		this.setTitle("Team Rocket's Media Center");
		this.setLayout(null);
		
		this.setContentPane(w_mainWindow);
		
		this.validate();
		this.setVisible(true);
		
		
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		
		// If It's set in config, show hardware management window.
		if (ConfigOpts.SHOW_HARDWARE){
			w_HardwareDisplay = new JFrame();
			w_HardwareDisplay.setSize(800,600);	
			w_HardwareDisplay.validate();
			w_HardwareDisplay.setTitle("Hardware"); //TODO
			w_HardwareDisplay.setVisible(true);
			w_HardwareDisplay.setBounds(this.getBounds().x + this.getBounds().width + 20, this.getBounds().y, 800, 600);
			
			frame_Hardware thispane_Hardware = new frame_Hardware();
			w_HardwareDisplay.setContentPane(thispane_Hardware.getPanel());
		}
		debugMessage.log(CLASS + "." + METHOD + " Finished.", 10);
	}
	
	
	public static void main(String[] args) {
		String METHOD = "main()";
		debugMessage.log(CLASS + "." + METHOD + " Called.", 10);
		
		@SuppressWarnings("unused")
		TeamRocket instance = new TeamRocket();
		
		debugMessage.log(CLASS + "." + METHOD + " Finished.", 10);
	}
	
	protected void finalize() throws Throwable
	{
		debugMessage.log("Object " + CLASS + " Destructed.", 11);
	}
}
